#!/usr/bin/env node
const program = require('commander');

const pkg = require('../package.json');
const cli = require('./cli');
const ui = require('./ui');
const { printHello } = require('./util/print');

printHello();

program.version(pkg.version);

program
  // command alias
  .alias('cm')

  // command description
  .description('Commit your code with forgetting the regulations.')

  // command options
  .option('-u, --ui', 'Use the GUI')

  // command action
  .action(cmd => {

    if (cmd.ui) {
      ui();
    } else {
      cli();
    }

  });

program.parse(process.argv);
